package com.qiqijuice.sales;

import com.db4o.Db4o;
import com.db4o.ObjectContainer;
import com.db4o.config.Configuration;

public class Db4oContainerFactory {
	static String dbFileName = "Sales";
	static ObjectContainer oc = null;
	
	{
	}
	
	public static ObjectContainer getDB() {
		if (oc == null) {
			Configuration config = Db4o.newConfiguration();
			config.objectClass(Order.class).cascadeOnUpdate(true);
			oc = Db4o.openFile(config, dbFileName);
		}
		
		return oc;
	}
}
